<link href="${STATIC}/lib/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${STATIC}/lib/treeTable/jquery.treeTable.min.js"></script> 

        <script type="text/javascript">
        $(function(){
            var option = {
                theme:'vsStyle',
                expandLevel : 2,
                beforeExpand : function($treeTable, id) {
                    //判断id是否已经有了孩子节点，如果有了就不再加载，这样就可以起到缓存的作用
                    if ($('.' + id, $treeTable).length) { return; }
                    //这里的html可以是ajax请求
                    var html = '<tr id="8" pId="6"><td>5.1</td><td>可以是ajax请求来的内容</td></tr>'
                             + '<tr id="9" pId="6"><td>5.2</td><td>动态的内容</td></tr>';

                    $treeTable.addChilds(html);
                },
                onSelect : function($treeTable, id) {
                    window.console && console.log('onSelect:' + id);
                    
                }

            };
            $('#treeTable1').treeTable(option);

            option.theme = 'default';
            $('#treeTable2').treeTable(option);
        });
        </script>
<div id="tab-system" class="HuiTab">
	<div class="tabBar cl">
		<span class="current">菜单列表</span>
		<span onclick="list_add()">添加菜单项</span>
	</div>
	<br>
</div>

<table id="treeTable2" style="width:100%" class="table table-border table-bordered table-bg table-striped table-hover">
<thead>
  <tr class="text-c">
    <th>名称</th>
    <th>链接</th>
    <th>可见</th>
    <th>操作</th>
  </tr>
</thead>
<tbody>
<% for(var menu in menuList){ %>
<tr id="${menu.id}" pId="${menu.parentId}">
  <td nowrap>${isNotEmpty(menu.icon)?"<i class='menu.icon'></i>"}<a href="/sys/menu/form?id=${menu.id}">${menu.name}</a></td>
  <td title="${menu.href}">${menu.href}</td>
  <td>${menu.isShow==1?'显示':'隐藏'}</td>
<td class="td-manage" width="110">
	<a class="btn btn-secondary size-MINI" href="javascript:;" title="编辑" onclick="list_edit('${obj.id}')"><i class="Hui-iconfont">&#xe6df;</i> 编辑</a> 
	<a class="btn btn-danger size-MINI" href="javascript:;" title="删除" onclick="list_del('${obj.id}')"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
</td>
</tr>
<% } %>
</tbody>
</table>

<script type="text/javascript">
function list_add(){
	var params = "";
	HtmlRender('${BASE}/admin/sys/menu/add'+params);
}
function list_edit(id,state){
    HtmlRender("${BASE}/admin/sys/menu/edit",{id:id});
}
</script>